<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Firmware for Arduino | PLEN Project Company Inc.: PLEN2::MotionController Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Firmware for Arduino | PLEN Project Company Inc.
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_p_l_e_n2_1_1_motion_controller.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_p_l_e_n2_1_1_motion_controller-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">PLEN2::MotionController Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Management class of a motion.  
 <a href="class_p_l_e_n2_1_1_motion_controller.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_motion_controller_8h_source.html">MotionController.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa3f187ddbd982dd686dac9f9e9cc13a5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#aa3f187ddbd982dd686dac9f9e9cc13a5">MotionController</a> (<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html">JointController</a> &amp;joint_ctrl)</td></tr>
<tr class="memdesc:aa3f187ddbd982dd686dac9f9e9cc13a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#aa3f187ddbd982dd686dac9f9e9cc13a5">More...</a><br /></td></tr>
<tr class="separator:aa3f187ddbd982dd686dac9f9e9cc13a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad56ae990d98f542af950b57d8a5da350"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#ad56ae990d98f542af950b57d8a5da350">playing</a> ()</td></tr>
<tr class="memdesc:ad56ae990d98f542af950b57d8a5da350"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decide if a motion is playing.  <a href="#ad56ae990d98f542af950b57d8a5da350">More...</a><br /></td></tr>
<tr class="separator:ad56ae990d98f542af950b57d8a5da350"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5fe3b0f097d862ab2a9a654df7822e2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#aa5fe3b0f097d862ab2a9a654df7822e2">frameUpdatable</a> ()</td></tr>
<tr class="memdesc:aa5fe3b0f097d862ab2a9a654df7822e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decide if a motion frame is updatable.  <a href="#aa5fe3b0f097d862ab2a9a654df7822e2">More...</a><br /></td></tr>
<tr class="separator:aa5fe3b0f097d862ab2a9a654df7822e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee08baf40139200cd3c115d4efd37084"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#aee08baf40139200cd3c115d4efd37084">updatingFinished</a> ()</td></tr>
<tr class="memdesc:aee08baf40139200cd3c115d4efd37084"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decide that updating a frame has finished.  <a href="#aee08baf40139200cd3c115d4efd37084">More...</a><br /></td></tr>
<tr class="separator:aee08baf40139200cd3c115d4efd37084"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a275b8539b5c887d5478b81a8f5227987"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#a275b8539b5c887d5478b81a8f5227987">nextFrameLoadable</a> ()</td></tr>
<tr class="memdesc:a275b8539b5c887d5478b81a8f5227987"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decide if there is a loadable frame at the next time.  <a href="#a275b8539b5c887d5478b81a8f5227987">More...</a><br /></td></tr>
<tr class="separator:a275b8539b5c887d5478b81a8f5227987"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66f20eddf7646703ea73f37343d71039"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#a66f20eddf7646703ea73f37343d71039">play</a> (uint8_t slot)</td></tr>
<tr class="memdesc:a66f20eddf7646703ea73f37343d71039"><td class="mdescLeft">&#160;</td><td class="mdescRight">Play a motion.  <a href="#a66f20eddf7646703ea73f37343d71039">More...</a><br /></td></tr>
<tr class="separator:a66f20eddf7646703ea73f37343d71039"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a455dd7f878db1d0ec2b07dbe7d934db0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#a455dd7f878db1d0ec2b07dbe7d934db0">playFrameDirectly</a> (const <a class="el" href="class_p_l_e_n2_1_1_motion_1_1_frame.html">Motion::Frame</a> &amp;frame)</td></tr>
<tr class="memdesc:a455dd7f878db1d0ec2b07dbe7d934db0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Play a frame directly.  <a href="#a455dd7f878db1d0ec2b07dbe7d934db0">More...</a><br /></td></tr>
<tr class="separator:a455dd7f878db1d0ec2b07dbe7d934db0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeaf8e0dbecb27d5930f5fe27e8df0b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#aeeaf8e0dbecb27d5930f5fe27e8df0b5">willStop</a> ()</td></tr>
<tr class="memdesc:aeeaf8e0dbecb27d5930f5fe27e8df0b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Will stop playing a motion.  <a href="#aeeaf8e0dbecb27d5930f5fe27e8df0b5">More...</a><br /></td></tr>
<tr class="separator:aeeaf8e0dbecb27d5930f5fe27e8df0b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a729bf985cf9091bb5a9a47546c54f86b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#a729bf985cf9091bb5a9a47546c54f86b">stop</a> ()</td></tr>
<tr class="memdesc:a729bf985cf9091bb5a9a47546c54f86b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop playing a motion.  <a href="#a729bf985cf9091bb5a9a47546c54f86b">More...</a><br /></td></tr>
<tr class="separator:a729bf985cf9091bb5a9a47546c54f86b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb0f165ee87fd90041c5e21f3a8e9a03"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#abb0f165ee87fd90041c5e21f3a8e9a03">updateFrame</a> ()</td></tr>
<tr class="separator:abb0f165ee87fd90041c5e21f3a8e9a03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f028bb8878afe17ee322a8fa7528fe9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#a8f028bb8878afe17ee322a8fa7528fe9">loadNextFrame</a> ()</td></tr>
<tr class="memdesc:a8f028bb8878afe17ee322a8fa7528fe9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load next frame.  <a href="#a8f028bb8878afe17ee322a8fa7528fe9">More...</a><br /></td></tr>
<tr class="separator:a8f028bb8878afe17ee322a8fa7528fe9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a227e72906320b5f345d5392db7a216f3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html#a227e72906320b5f345d5392db7a216f3">dump</a> (uint8_t slot)</td></tr>
<tr class="memdesc:a227e72906320b5f345d5392db7a216f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dump a motion with JSON format.  <a href="#a227e72906320b5f345d5392db7a216f3">More...</a><br /></td></tr>
<tr class="separator:a227e72906320b5f345d5392db7a216f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Management class of a motion. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa3f187ddbd982dd686dac9f9e9cc13a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PLEN2::MotionController::MotionController </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html">JointController</a> &amp;&#160;</td>
          <td class="paramname"><em>joint_ctrl</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_ctrl</td><td>An instance of joint controller. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a227e72906320b5f345d5392db7a216f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::MotionController::dump </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>slot</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Dump a motion with JSON format. </p>
<p>Output JSON string like a "motion.json", however, property "device"'s type is not string but integer defined as device id in "device_map.json".</p>
<dl class="section see"><dt>See also</dt><dd><ul>
<li><a href="https://github.com/plenprojectcompany/PLEN2/tree/master/motion">https://github.com/plenprojectcompany/PLEN2/tree/master/motion</a></li>
<li><a href="https://github.com/plenprojectcompany/plen-ControlServer/blob/master/control_server/device_map.json">https://github.com/plenprojectcompany/plen-ControlServer/blob/master/control_server/device_map.json</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">slot</td><td>Slot of a motion. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa5fe3b0f097d862ab2a9a654df7822e2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::MotionController::frameUpdatable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decide if a motion frame is updatable. </p>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="a8f028bb8878afe17ee322a8fa7528fe9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::MotionController::loadNextFrame </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Load next frame. </p>

</div>
</div>
<a class="anchor" id="a275b8539b5c887d5478b81a8f5227987"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::MotionController::nextFrameLoadable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decide if there is a loadable frame at the next time. </p>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="a66f20eddf7646703ea73f37343d71039"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::MotionController::play </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>slot</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Play a motion. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">slot</td><td>Number of a motion. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a455dd7f878db1d0ec2b07dbe7d934db0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::MotionController::playFrameDirectly </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_p_l_e_n2_1_1_motion_1_1_frame.html">Motion::Frame</a> &amp;&#160;</td>
          <td class="paramname"><em>frame</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Play a frame directly. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">frame</td><td>An instance of frame </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad56ae990d98f542af950b57d8a5da350"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::MotionController::playing </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decide if a motion is playing. </p>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="a729bf985cf9091bb5a9a47546c54f86b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::MotionController::stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stop playing a motion. </p>

</div>
</div>
<a class="anchor" id="abb0f165ee87fd90041c5e21f3a8e9a03"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::MotionController::updateFrame </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aee08baf40139200cd3c115d4efd37084"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::MotionController::updatingFinished </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decide that updating a frame has finished. </p>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="aeeaf8e0dbecb27d5930f5fe27e8df0b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::MotionController::willStop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Will stop playing a motion. </p>
<p>The method doesn't stop playing a motion just after running itself, but will stop it when a frame that has the stop flag is discovered. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_motion_controller_8h_source.html">MotionController.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_p_l_e_n2.html">PLEN2</a></li><li class="navelem"><a class="el" href="class_p_l_e_n2_1_1_motion_controller.html">MotionController</a></li>
    <li class="footer">Generated on Tue Oct 11 2016 13:20:21 for Firmware for Arduino | PLEN Project Company Inc. by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
